package com.qf.springboot230203.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;


//用于给layui返回json数据
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TableVO<T> {

    private Integer code;
    private String msg;
    private Integer count;
    private List<T> data;

    public static TableVO ok(){
        final TableVO oneVo = new TableVO();
        oneVo.setCode(0);
        oneVo.setMsg("ok");
        return oneVo;
    }
    public static TableVO ok(Integer count,List data){
        final TableVO oneVo = new TableVO();
        oneVo.setCode(0);
        oneVo.setMsg("ok");
        oneVo.setCount(count);
        oneVo.setData(data);
        return oneVo;
    }
}
